_gdk_wayland_display_update_serial (display, serial);
+ if (!wl_surface)
+ return;
+
touch = gdk_wayland_seat_add_touch (seat, id, wl_surface);
touch->x = wl_fixed_to_double (x);
touch->y = wl_fixed_to_double (y);
_gdk_wayland_display_update_serial (display, serial);
touch = gdk_wayland_seat_get_touch (seat, id);
+ if (!touch)
+ return;
+
event = gdk_touch_event_new (GDK_TOUCH_END,
GDK_SLOT_TO_EVENT_SEQUENCE (touch->id),
touch->surface,
GdkEvent *event;
touch = gdk_wayland_seat_get_touch (seat, id);
+ if (!touch)
+ return;
+
touch->x = wl_fixed_to_double (x);
touch->y = wl_fixed_to_double (y);
GdkWaylandTabletData *tablet = zwp_tablet_v2_get_user_data (wp_tablet);
GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (tablet->seat);
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (seat->display);
- GdkSurface *surface = wl_surface_get_user_data (wsurface);
+ GdkSurface *surface;
GdkEvent *event;
+ if (!wsurface)
+ return;
+
+ surface = wl_surface_get_user_data (wsurface);
+
if (!surface)
return;
if (!GDK_IS_SURFACE (surface))
GdkWaylandTabletData *tablet = tool->current_tablet;
GdkEvent *event;
+ if (!tablet)
+ return;
+
GDK_SEAT_NOTE (tool->seat, EVENTS,
g_message ("proximity out, seat %p, tool %d", tool->seat,
gdk_device_tool_get_tool_type (tool->tool)));
GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (tool->seat);
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (seat->display);
- if (!tablet->pointer_info.focus)
+ if (!tablet || !tablet->pointer_info.focus)
return;
_gdk_wayland_display_update_serial (display_wayland, serial);
GdkWaylandTabletToolData *tool = data;
GdkWaylandTabletData *tablet = tool->current_tablet;
- if (!tablet->pointer_info.focus)
+ if (!tablet || !tablet->pointer_info.focus)
return;
tablet_create_button_event_frame (tablet, GDK_BUTTON_RELEASE, GDK_BUTTON_PRIMARY);
GdkWaylandTabletData *tablet = tool->current_tablet;
GdkEvent *event;
+ if (!tablet)
+ return;
+
tablet->pointer_info.surface_x = wl_fixed_to_double (sx);
tablet->pointer_info.surface_y = wl_fixed_to_double (sy);
{
GdkWaylandTabletToolData *tool = data;
GdkWaylandTabletData *tablet = tool->current_tablet;
- int axis_index = tablet->axis_indices[GDK_AXIS_PRESSURE];
+ int axis_index;
+
+ if (!tablet)
+ return;
+
+ axis_index = tablet->axis_indices[GDK_AXIS_PRESSURE];
_gdk_device_translate_axis (tablet->stylus_device, axis_index,
pressure, &tablet->axes[GDK_AXIS_PRESSURE]);
{
GdkWaylandTabletToolData *tool = data;
GdkWaylandTabletData *tablet = tool->current_tablet;
- int axis_index = tablet->axis_indices[GDK_AXIS_DISTANCE];
+ int axis_index;
+
+ if (!tablet)
+ return;
+
+ axis_index = tablet->axis_indices[GDK_AXIS_DISTANCE];
_gdk_device_translate_axis (tablet->stylus_device, axis_index,
distance, &tablet->axes[GDK_AXIS_DISTANCE]);
{
GdkWaylandTabletToolData *tool = data;
GdkWaylandTabletData *tablet = tool->current_tablet;
- int xtilt_axis_index = tablet->axis_indices[GDK_AXIS_XTILT];
- int ytilt_axis_index = tablet->axis_indices[GDK_AXIS_YTILT];
+ int xtilt_axis_index;
+ int ytilt_axis_index;
+
+ if (!tablet)
+ return;
+
+ xtilt_axis_index = tablet->axis_indices[GDK_AXIS_XTILT];
+ ytilt_axis_index = tablet->axis_indices[GDK_AXIS_YTILT];
_gdk_device_translate_axis (tablet->stylus_device, xtilt_axis_index,
wl_fixed_to_double (xtilt),
GdkEventType evtype;
guint n_button;
- if (!tablet->pointer_info.focus)
+ if (!tablet || !tablet->pointer_info.focus)
return;
tablet->pointer_info.press_serial = serial;
{
GdkWaylandTabletToolData *tool = data;
GdkWaylandTabletData *tablet = tool->current_tablet;
- int axis_index = tablet->axis_indices[GDK_AXIS_ROTATION];
+ int axis_index;
+
+ if (!tablet)
+ return;
+
+ axis_index = tablet->axis_indices[GDK_AXIS_ROTATION];
_gdk_device_translate_axis (tablet->stylus_device, axis_index,
wl_fixed_to_double (degrees),
{
GdkWaylandTabletToolData *tool = data;
GdkWaylandTabletData *tablet = tool->current_tablet;
- int axis_index = tablet->axis_indices[GDK_AXIS_SLIDER];
+ int axis_index;
+
+ if (!tablet)
+ return;
+
+ axis_index = tablet->axis_indices[GDK_AXIS_SLIDER];
_gdk_device_translate_axis (tablet->stylus_device, axis_index,
position, &tablet->axes[GDK_AXIS_SLIDER]);
{
GdkWaylandTabletToolData *tool = data;
GdkWaylandTabletData *tablet = tool->current_tablet;
- GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (tablet->seat);
+ GdkWaylandSeat *seat;
GdkEvent *event;
+ if (!tablet)
+ return;
+
+ seat = GDK_WAYLAND_SEAT (tablet->seat);
+
GDK_SEAT_NOTE (seat, EVENTS,
g_message ("tablet tool %d wheel %d/%d",
gdk_device_tool_get_tool_type (tool->tool), degrees, clicks));
GdkWaylandTabletData *tablet = tool->current_tablet;
GdkEvent *frame_event;
+ if (!tablet)
+ return;
+
GDK_SEAT_NOTE (tablet->seat, EVENTS,
g_message ("tablet frame, time %d", time));